function load_responsive_main_menu(a){var e=a("body").hasClass("disable-flexible-menu")?!0:!1;if(!e){var n=a(".nasa-check-reponsive.nasa-switch-check").length&&1===a(".nasa-check-reponsive.nasa-switch-check").width()?!0:!1;if(!n&&a(".nasa-menus-wrapper-reponsive").length){var t=a(window).width(),s=1200;a('[name="nsmw-page"]').length?s=parseInt(a('[name="nsmw-page"]').attr("content")):a('[name="nsmw-cat"]').length?s=parseInt(a('[name="nsmw-cat"]').attr("content")):a('[name="nsmw-theme"]').length&&(s=parseInt(a('[name="nsmw-theme"]').val())),a(".nasa-menus-wrapper-reponsive").each(function(){var e=a(this),n=t/s;if(1>n){var i=a(e).attr("data-padding_x"),r={"font-size":(100*n).toString()+"%"};a("body").hasClass("nasa-rtl")?(r["margin-left"]=(n*i).toString()+"px",r["margin-right"]="0"):(r["margin-right"]=(n*i).toString()+"px",r["margin-left"]="0"),a(e).find(".header-nav > li > a").css(r),a(e).find(".nasa-title-vertical-menu").length&&a(e).find(".nasa-title-vertical-menu").css({"font-size":(100*n).toString()+"%"})}else a(e).find(".header-nav > li > a").removeAttr("style"),a(e).find(".nasa-title-vertical-menu").length&&a(e).find(".nasa-title-vertical-menu").removeAttr("style")})}}}function resize_megamenu_vertical(a){a(".wide-nav .vertical-menu-container").length&&a(".wide-nav .vertical-menu-container").each(function(){var e=a(this);if(a(e).parents(".vitems-root").length<1){var n=a(e).parents(".nasa-vertical-header").length?a(e).parents(".nasa-vertical-header").width():0;n=280>n?280:n,a(e).css({width:n})}else{var t=a(e).parents(".vitems-root"),s=parseInt(a(t).attr("data-limit"));if(s&&a(e).find(".menu-item").length>s){var i=a(t).attr("data-more"),r=0;a(e).find(".menu-item").each(function(){var e=a(this);r>=s&&a(e).addClass("vroot-hidden"),r++}),a(e).find(".vertical-menu-wrapper").append('<li class="menu-show-more"><a class="vroot-show-more" href="javascript:void(0);" rel="nofollow"><svg class="margin-right-5 rtl-margin-right-0 rtl-margin-left-5" width="15" height="15" viewBox="0 0 32 32" fill="currentColor"><path d="M16 2.672c-7.362 0-13.328 5.966-13.328 13.328s5.966 13.328 13.328 13.328c7.362 0 13.328-5.966 13.328-13.328s-5.966-13.328-13.328-13.328zM16 28.262c-6.761 0-12.262-5.501-12.262-12.262s5.501-12.262 12.262-12.262c6.761 0 12.262 5.501 12.262 12.262s-5.501 12.262-12.262 12.262z"/><path d="M16.533 8.003h-1.066v7.464h-7.428v1.066h7.428v7.428h1.066v-7.428h7.464v-1.066h-7.464z"/></svg>'+i+"</a></li>")}}})}function init_top_categories_filter(a){if(a(".nasa-top-cat-filter").length){var e,n;a(".nasa-top-cat-filter").each(function(){var t=a(this),s=a(t).find(".root-item");if(e=!1,n=null,a(s).length&&(a(s).each(function(){var t=a(this);a(t).hasClass("active")&&(a(t).addClass("nasa-current-top"),n=a(t),e=!0),a(t).find(".children .nasa-current-note").remove()}),e||a(s).each(function(){var t=a(this);a(t).hasClass("cat-parent")&&!e&&(a(t).addClass("nasa-current-top"),n=a(t),e=!0)}),null!==n)){var i=a(n).width();if(i){var r=a(n).position(),o=a(n).parents(".nasa-top-cat-filter").find(".nasa-current-note");a(o).css({width:i,left:r.left,top:a(n).height()-1})}}})}}function init_header_responsive(a){if(a(".header-type-builder").length<1&&a("#tmpl-nasa-responsive-header").length&&(a(".nasa-menu-off").length||a(".nasa-mobile-check").length&&a(".nasa-mobile-check").width())&&a("#masthead").length&&a("#masthead").find(".header-responsive").length<=0){var e=a(".cart-inner").length?a(".cart-inner").clone():null,n=a("#tmpl-nasa-responsive-header").html();""!==n&&(a("#masthead").prepend(n),e&&(a(".header-responsive .cart-inner").html(a(e).html()),a("body").trigger("ns_header_responsive_loaded")))}}function auto_fill_input_placeholder(a,e,n){var t="undefined"!=typeof n?n:0;if(0===t&&a(e).trigger("focus"),!a(e).hasClass("nasa-placeholder")){a(e).addClass("nasa-placeholder");var s=a(e).attr("placeholder");a(e).attr("data-placeholder",s)}var i=a(e).attr("data-suggestions");i&&t<=i.length?(a(e).hasClass("nasa-filling")||a(e).addClass("nasa-filling"),a(e).attr("placeholder",i.substr(0,t++)),setTimeout(function(){auto_fill_input_placeholder(a,e,t)},90)):(a(e).hasClass("nasa-done")||a(e).addClass("nasa-done"),a(e).removeClass("nasa-filling"),setTimeout(function(){reverse_fill_input_placeholder(a,e)},400))}function reverse_fill_input_placeholder(a,e,n){var t=a(e).attr("data-suggestions"),s="undefined"!=typeof n?n:t?t.length:0;if(s>0)a(e).attr("placeholder",t.substr(0,s--)),setTimeout(function(){reverse_fill_input_placeholder(a,e,s)},20);else{var i=a(e).attr("data-placeholder");a(e).attr("placeholder",i)}}jQuery(document).ready(function(a){"use strict";var e=a(".nasa-check-reponsive.nasa-switch-check").length&&1===a(".nasa-check-reponsive.nasa-switch-check").width()?!0:!1,n=200;a("body").on("mousemove",".vertical-menu-container .nasa-megamenu",function(){var e=a(this).parents(".vertical-menu-wrapper"),t=a(e).outerHeight();a(e).find(".nasa-megamenu").removeClass("nasa-curent-hover"),a(e).addClass("nasa-curent-hover");var s=a(e).parents(".row").length?a(e).parents(".row"):a(e).parents(".nasa-row");a(s).length<=0&&(s=a(e).parents(".elementor-container"));var i,r,o,l=a(s).length?a(s).width():900;a(e).find(".nasa-megamenu").each(function(){var e=a(this),s=a(e).outerWidth();i=r=l-s,a(e).hasClass("cols-5")||a(e).hasClass("fullwidth")?i-=20:a(e).hasClass("cols-2")?(i=i/5*2+50,o=2*n,i=o>i&&r>o?o:i):a(e).hasClass("cols-3")?(i=i/5*3+50,o=3*n,i=o>i&&r>o?o:i):a(e).hasClass("cols-4")&&(i=i/5*4+50,o=4*n,i=o>i&&r>o?o:i),a(e).find(">.nav-dropdown").css({width:i}).show(),a(e).find(">.nav-dropdown >.sub-menu").length&&a(e).find(">.nav-dropdown >.sub-menu").css({"min-height":t})})}),a("body").on("mouseover",".vertical-menu-wrapper .menu-item-has-children.default-menu",function(){var e=a(this).parents(".vertical-menu-wrapper");a(this).find("> .nav-dropdown > .sub-menu").css({width:n});var t=a(e).parents(".row").length?a(e).parents(".row"):a(e).parents(".nasa-row");a(t).length<=0&&(t=a(e).parents(".elementor-container"));var s,i,r,o=a(t).length?a(t).width():900;a(e).find(".nasa-megamenu").each(function(){var e=a(this),t=a(e).outerWidth();s=i=o-t,a(e).hasClass("cols-5")||a(e).hasClass("fullwidth")?s-=20:a(e).hasClass("cols-2")?(s=s/5*2+50,r=2*n,s=r>s&&i>r?r:s):a(e).hasClass("cols-3")?(s=s/5*3+50,r=3*n,s=r>s&&i>r?r:s):a(e).hasClass("cols-4")&&(s=s/5*4+50,r=4*n,s=r>s&&i>r?r:s),a(e).find(">.nav-dropdown").css({width:s})})}),a("body").on("nasa_index_menu_root_items",function(){if(!a(".nasa-header-canvas #site-navigation").hasClass("indexed")){if(a(".nasa-header-canvas #site-navigation .root-item").length){var e=0;a(".nasa-header-canvas #site-navigation .root-item").each(function(){a(this).attr("data-index",e),e++})}a(".nasa-header-canvas #site-navigation").addClass("indexed")}}),a("body").on("nasa_header_canvas",function(){if(a(".nasa-header-canvas #site-navigation").length&&(a("body").trigger("nasa_index_menu_root_items"),a(".nasa-header-canvas #site-navigation .root-item.act").length<1)){var e=null;e=a(".nasa-header-canvas #site-navigation .root-item.current-menu-item").length?a(".nasa-header-canvas #site-navigation .root-item.current-menu-item").eq(0):a(".nasa-header-canvas #site-navigation .root-item.current-menu-ancestor").length?a(".nasa-header-canvas #site-navigation .root-item.current-menu-ancestor").eq(0):a(".nasa-header-canvas #site-navigation .root-item.current-menu-parent").length?a(".nasa-header-canvas #site-navigation .root-item.current-menu-parent").eq(0):a(".nasa-header-canvas #site-navigation .root-item:first-child"),a(e).length&&(a(e).addClass("act"),a("body").trigger("nasa_render_template",[e]))}}),a("body").on("mousemove",".nasa-header-canvas #site-navigation .root-item",function(){var e=a(this);a("body").trigger("nasa_index_menu_root_items");var n=a(e).attr("data-index");a(".nasa-header-canvas #site-navigation .root-item").each(function(){var e=a(this).attr("data-index");n===e?a(this).hasClass("act")||a(this).addClass("act"):a(this).removeClass("act")})}),a("body").on("nasa_after_loaded_ajax_complete",function(){a("body").trigger("nasa_header_canvas")}),init_header_responsive(a),resize_megamenu_vertical(a),a("body").on("click",".vroot-show-more",function(){var e=a(this).parents(".vertical-menu-wrapper");a(e).find(".vroot-hidden").fadeIn(),a(e).find(".menu-show-more").remove()});var t;!e&&a(window).width()<1200&&(t=setTimeout(function(){load_responsive_main_menu(a)},5)),a(window).on("resize",function(){if(e=a(".nasa-check-reponsive.nasa-switch-check").length&&1===a(".nasa-check-reponsive.nasa-switch-check").width()?!0:!1,a(".nasa-modern-layout.nasa-show").length){var n=a(".nasa-modern-layout.nasa-show");a("body").trigger("search_icon_position",[n])}e&&init_header_responsive(a),init_top_categories_filter(a),e||(a(".wide-nav .vertical-menu-container").length&&a(".wide-nav .vertical-menu-container").each(function(){var e=a(this);if(a(e).parents(".vitems-root").length<1){var n=a(e).parents(".nasa-vertical-header").length?a(e).parents(".nasa-vertical-header").width():0;n=280>n?280:n,a(e).css({width:n})}}),"undefined"!=typeof t&&clearTimeout(t),t=setTimeout(function(){load_responsive_main_menu(a)},1100))}),a("body").on("nasa_init_topbar_categories",function(){init_top_categories_filter(a)}),init_top_categories_filter(a),a("body").on("mouseover",".nasa-top-cat-filter .root-item",function(){var e=a(this),n=a(e).parents(".nasa-top-cat-filter");a(n).find(".root-item").removeClass("nasa-current-top"),a(e).addClass("nasa-current-top");var t=a(e).position(),s=a(n).find("> .nasa-current-note");return a(s).css({width:a(e).width(),left:t.left,top:a(e).height()-1+t.top-1}),!1}),a("body").on("mouseover",".nasa-top-cat-filter .children .cat-item",function(){var e=a(this),n=a(e).parent(".children"),t=a(n).find(">.nasa-current-note");a(t).length<=0&&(a(n).prepend('<li class="nasa-current-note"></li>'),t=a(n).find(">.nasa-current-note")),a(n).find(".cat-item").removeClass("nasa-current-child"),a(e).addClass("nasa-current-child");var s=a(e).position();return a(t).css({width:a(e).width(),left:s.left,top:a(e).height()-1+s.top-1}),!1});var s=!1;a("body").on("click",".desk-search",function(e){var n=a(this),t=a(n).parents(".nasa-wrap-event-search");if(a(t).find(".nasa-tmpl-search").length){var i=a(t).find(".nasa-tmpl-search").html();a(t).find(".nasa-tmpl-search").replaceWith(i)}a(n).hasClass("nasa-disable")||(a(n).addClass("nasa-disable"),setTimeout(function(){var e=a(n).parents(".nasa-wrap-event-search").find(".nasa-show-search-form"),t=a(n).attr("data-open");"0"===t?a("#header-content").find(".nasa-show-search-form").after('<div class="nasa-tranparent" />'):a("#header-content").find(".nasa-tranparent").remove(),a("body").trigger("search_icon_position",[e]),a(".desk-search").each(function(){var e=a(this),n=a(e).parents(".nasa-wrap-event-search"),s=a(n).find(".nasa-elements-wrap"),i=a(n).find(".nasa-show-search-form");"undefined"==typeof t||"0"===t?(a(e).attr("data-open","1"),a(i).hasClass("nasa-show")||a(i).addClass("nasa-show"),a(i).hasClass("nasa-modern-layout")||a(s).addClass("nasa-invisible")):(a(e).attr("data-open","0"),a(i).hasClass("nasa-show")&&a(i).removeClass("nasa-show"),a(s).removeClass("nasa-invisible"))}),s?setTimeout(function(){a(n).removeClass("nasa-disable"),a(e).find("label").length&&a(e).find("label").trigger("click")},1e3):(a(n).removeClass("nasa-disable"),setTimeout(function(){s=!0;var n="";if(a(e).find('input[name="s"]').length){var t=a(e).find('input[name="s"]');n=a(t).val(),""!==n&&a(t).val(n),auto_fill_input_placeholder(a,t),a(e).find("label").length&&a(e).find("label").trigger("click")}},1e3))},10)),e.preventDefault()}),a("body").on("search_icon_position",function(e,n){if(a(n).hasClass("nasa-modern-layout")){if(a("#header-content .nasa-tranparent").length&&!a("#header-content .nasa-tranparent").hasClass("bg-black")&&a("#header-content .nasa-tranparent").addClass("bg-black"),a("#wpadminbar").length){var t=a("#wpadminbar").height();a(n).css({top:t})}if(a(n).find(".nasa-icon-submit-page").length){var s=a(n).find(".nasa-icon-submit-page"),i=a(n).find('input[name="s"]').offset(),r=a("body").hasClass("nasa-rtl")?0:a(n).find('input[name="s"]').width()-a(s).width();a(s).css({left:i.left+r,right:"auto",visibility:"visible",opacity:"0.3"})}}}),a("body").on("click",".filter-cat-icon",function(){var e=a(this);if(!a(e).hasClass("nasa-disable")){if(a(e).addClass("nasa-disable"),a("#nasa-main-cat-filter .nasa-tmpl").length){var n=a("#nasa-main-cat-filter .nasa-tmpl").html();a("#nasa-main-cat-filter .nasa-tmpl").replaceWith(n),a("#nasa-main-cat-filter .current-cat").length?a("#nasa-main-cat-filter").find(".current-cat-parent, .current-cat").trigger("mouseover"):a("#nasa-main-cat-filter .root-item:first-child").trigger("mouseover")}a(".nasa-elements-wrap").addClass("nasa-invisible"),a("#header-content .nasa-top-cat-filter-wrap").addClass("nasa-show"),a(".nasa-has-filter-ajax").length<=0&&a("#header-content .nasa-top-cat-filter-wrap").before('<div class="nasa-tranparent-filter nasa-hide-for-mobile" />'),setTimeout(function(){a(e).removeClass("nasa-disable")},600)}}),a("body").on("mouseover",".product-item",function(){var e=a(this),n=a('input[name="nasa-toggle-width-product-content"]').length?parseInt(a('input[name="nasa-toggle-width-product-content"]').val()):180;a(e).outerWidth()<n?(a(e).find(".add-to-cart-grid").length&&!a(e).find(".add-to-cart-grid").hasClass("nasa-disabled-hover")&&a(e).find(".add-to-cart-grid").addClass("nasa-disabled-hover"),a(e).find(".nasa-sc-pdeal-countdown")&&!a(e).find(".nasa-sc-pdeal-countdown").hasClass("nasa-countdown-small")&&a(e).find(".nasa-sc-pdeal-countdown").addClass("nasa-countdown-small")):(a(e).find(".add-to-cart-grid").length&&a(e).find(".add-to-cart-grid").removeClass("nasa-disabled-hover"),a(e).find(".nasa-sc-pdeal-countdown")&&a(e).find(".nasa-sc-pdeal-countdown").removeClass("nasa-countdown-small"))}),a("body").on("click",".nasa-menu-off",function(){init_header_responsive(a),a("#nasa-menu-sidebar-content").length&&!a("#nasa-menu-sidebar-content").hasClass("all-screen")&&a("#nasa-menu-sidebar-content").addClass("all-screen"),a(".nasa-mobile-menu_toggle").length&&a(".nasa-mobile-menu_toggle").trigger("click")}),a("body").on("click",".nasa-header-off",function(){a("body").trigger("nasa_header_canvas"),a(".nasa-header-canvas").length&&!a(".nasa-header-canvas").hasClass("nasa-active")&&a(".nasa-header-canvas").addClass("nasa-active"),a("body").hasClass("ovhd")||a("body").addClass("ovhd")}),a("body").on("nasa_after_loaded_ajax_complete",function(){init_header_responsive(a),resize_megamenu_vertical(a),load_responsive_main_menu(a)})});